import axi from 'axios';

export default {
  getUserInfoApi(p) {
    return axi.get('/bcandidate/getInfo', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getNewTimeApi(p) {
    return axi.get('/bcandidate/getNewTime', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  updateUserInfo1(id, p) {
    return axi.put(`/sysuser/update/${id}`, p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  updateUserInfo2(id, p) {
    return axi.put(`/bcandidate/updateByUserId/${id}`, p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  deleteExpApi(id) {
    return axi.delete(`/bexperience/delete/${id}`, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  deleteEduApi(id) {
    return axi.delete(`/bedubackground/delete/${id}`, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  deleteDerApi(id) {
    return axi.delete(`/bdirection/delete/${id}`, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getJobsInfoLoginApi(p) {
    return axi.get('/bjob/queryBJobsByDirection', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  addEduApi(p) {
    return axi.post('/bedubackground/addByUserId', p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  addExpApi(p) {
    return axi.post('/bexperience/addByUserId', p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  addDerApi(p) {
    return axi.post('/bdirection/addByUserId', p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  updateDerApi(id, p) {
    return axi.put(`/bdirection/update/${id}`, p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  updateExpApi(id, p) {
    return axi.put(`/bexperience/update/${id}`, p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  updateEduApi(id, p) {
    return axi.put(`/bedubackground/update/${id}`, p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getCityApi() {
    return axi.get('/ecity/queryECitys', {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getAllTypeApi() {
    return axi.get('/auth/queryEJobTypesWoAu', {
    });
  },
  uploadFile(p) {
    return axi.post('/auth/uploadFile', p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
        'Content-Type': 'multipart/form-data',
      },
    });
  },
  deleteFileApi(id) {
    return axi.delete(`/bcandidatefile/delete/${id}`, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
};
